import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddDesignPublicField1703000000004 implements MigrationInterface {
  name = 'AddDesignPublicField1703000000004';

  public async up(queryRunner: QueryRunner): Promise<void> {
    // 添加 is_public 字段到 designs 表
    await queryRunner.query(`
      ALTER TABLE \`designs\` 
      ADD COLUMN \`is_public\` tinyint NOT NULL DEFAULT 1
    `);
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    // 删除 is_public 字段
    await queryRunner.query(`
      ALTER TABLE \`designs\` 
      DROP COLUMN \`is_public\`
    `);
  }
}